package org.dromara.wms.domain;

  import org.dromara.common.tenant.core.TenantEntity;
import com.alibaba.excel.annotation.ExcelProperty;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import jakarta.validation.constraints.*;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
  import java.util.Date;
  import com.fasterxml.jackson.annotation.JsonFormat;

import java.io.Serial;

/**
 * 生产工单对象 wms_task
 *
 * @author wenrui Su
 * @date 2024-05-05
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("wms_task")
public class WmsTask extends TenantEntity {

@Serial
private static final long serialVersionUID=1L;


  @ExcelProperty(value = "任务id")
  @NotNull(message = "任务id不能为空", groups = { EditGroup.class })
  @TableId(value = "id")
  private Long id;

  @ExcelProperty(value = "任务名称")
  @NotBlank(message = "任务名称不能为空", groups = { AddGroup.class, EditGroup.class })
  private String taskName;

  @ExcelProperty(value = "计划单号")
  @NotNull(message = "计划单号不能为空", groups = { AddGroup.class, EditGroup.class })
  private Long scheduleLineId;

  @ExcelProperty(value = "物料单号")
  @NotNull(message = "物料单号不能为空", groups = { AddGroup.class, EditGroup.class })
  private Long bomId;

  @ExcelProperty(value = "排序")
  @NotNull(message = "排序不能为空", groups = { AddGroup.class, EditGroup.class })
  private Long sort;

  @ExcelProperty(value = "物品id")
  @NotNull(message = "物品id不能为空", groups = { AddGroup.class, EditGroup.class })
  private Long productId;

  @ExcelProperty(value = "批次号")
  @NotBlank(message = "批次号不能为空", groups = { AddGroup.class, EditGroup.class })
  private String batchCode;

  @ExcelProperty(value = "开始生产时间")
  @NotNull(message = "开始生产时间不能为空", groups = { AddGroup.class, EditGroup.class })
  private Date startTime;

  @ExcelProperty(value = "完成生产时间")
  @NotNull(message = "完成生产时间不能为空", groups = { AddGroup.class, EditGroup.class })
  private Date endTime;

  @ExcelProperty(value = "任务状态")
  @NotBlank(message = "任务状态不能为空", groups = { AddGroup.class, EditGroup.class })
  private String status;

  @ExcelProperty(value = "生产数量")
  @NotNull(message = "生产数量不能为空", groups = { AddGroup.class, EditGroup.class })
  private Double quantity;

  //物品名称
  @TableField(exist = false)
  private String productName;

  //生产线名称
  @TableField(exist = false)
  private Long workshopLineId;

}
